package com.fivefu.core.hik.dto.response;

import com.fivefu.base.common.utils.str.StrUtils;
import com.fivefu.core.hik.entity.DbHikRegions;

public class RegionsByParamsResp {

    /**
     * 区域编号
     */
    private String indexCode;

    /**
     * 区域名称
     */
    private String name;

    /**
     * 区域完整路径，含本节点，@进行分割，上级节点在前
     */
    private String regionPath;

    /**
     * 父区域唯一标识码
     */
    private String parentIndexCode;

    /**
     * 用于标识区域节点是否有权限操作
     */
    private boolean available;

    /**
     * true:是叶子节点，表示该区域下面未挂区域 false:不是叶子节点，表示该区域下面挂有区域
     */
    private boolean leaf;

    /**
     * 级联平台标识，多个级联编号以@分隔，本级区域默认值“0”
     */
    private String cascadeCode;

    /**
     * 区域标识
     */
    private Integer cascadeType;

    /**
     * 区域类型
     */
    private String catalogType;

    /**
     * 外码(如：国际码)
     */
    private String externalIndexCode;

    /**
     * 父外码(如：国际码)
     */
    private String parentExternalIndexCode;
    /**
     * 同级区域顺序
     */
    private Integer sort;

    /**
     * 本区域资源数量
     */
    private Integer localQuantity;

    /**
     * 本区域及下级区域资源数量
     */
    private Integer totalQuantity;

    /**
     * 创建时间，要求遵守ISO8601标准 如2018-07-26T21:30:08.322+08:00
     */
    private String createTime;

    /**
     * 更新时间，要求遵守ISO8601标准 如2018-07-26T21:30:08.322+08:00
     */
    private String updateTime;

    /**
     * 资源状态，小于0则代表资源已被删除，0代表有效资源
     * @return
     */
    private Integer status;

    public String getIndexCode() {
        return indexCode;
    }

    public void setIndexCode(String indexCode) {
        this.indexCode = indexCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRegionPath() {
        return regionPath;
    }

    public void setRegionPath(String regionPath) {
        this.regionPath = regionPath;
    }

    public String getParentIndexCode() {
        return parentIndexCode;
    }

    public void setParentIndexCode(String parentIndexCode) {
        this.parentIndexCode = parentIndexCode;
    }

    public boolean isAvailable() {
        return available;
    }

    public void setAvailable(boolean available) {
        this.available = available;
    }

    public boolean isLeaf() {
        return leaf;
    }

    public void setLeaf(boolean leaf) {
        this.leaf = leaf;
    }

    public String getCascadeCode() {
        return cascadeCode;
    }

    public void setCascadeCode(String cascadeCode) {
        this.cascadeCode = cascadeCode;
    }

    public Integer getCascadeType() {
        return cascadeType;
    }

    public void setCascadeType(Integer cascadeType) {
        this.cascadeType = cascadeType;
    }

    public String getCatalogType() {
        return catalogType;
    }

    public void setCatalogType(String catalogType) {
        this.catalogType = catalogType;
    }

    public String getExternalIndexCode() {
        return externalIndexCode;
    }

    public void setExternalIndexCode(String externalIndexCode) {
        this.externalIndexCode = externalIndexCode;
    }

    public String getParentExternalIndexCode() {
        return parentExternalIndexCode;
    }

    public void setParentExternalIndexCode(String parentExternalIndexCode) {
        this.parentExternalIndexCode = parentExternalIndexCode;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getLocalQuantity() {
        return localQuantity;
    }

    public void setLocalQuantity(Integer localQuantity) {
        this.localQuantity = localQuantity;
    }

    public Integer getTotalQuantity() {
        return totalQuantity;
    }

    public void setTotalQuantity(Integer totalQuantity) {
        this.totalQuantity = totalQuantity;
    }

    public DbHikRegions replaceDbHikRegions(){
        DbHikRegions regions = new DbHikRegions();
        regions.setIndexCode(this.indexCode);
        regions.setName(this.name);
        regions.setRegionPath(this.regionPath);
        regions.setParentIndexCode(this.parentIndexCode);
        regions.setAvailable(this.available);
        regions.setLeaf(this.leaf);
        regions.setCascadeCode(this.cascadeCode);
        regions.setCascadeType(this.cascadeType);
        regions.setCatalogType(this.catalogType);
        regions.setExternalIndexCode(this.externalIndexCode);
        regions.setParentExternalIndexCode(StrUtils.isNotNull(this.parentExternalIndexCode) ? this.parentExternalIndexCode : null);
        regions.setSort(this.sort);
        regions.setLocalQuantity(this.localQuantity);
        regions.setTotalQuantity(this.totalQuantity);
        regions.setCreateTime(this.createTime);
        regions.setUpdateTime(this.updateTime);
        regions.setRegionStatus(this.status);
        return regions;
    }
}
